import axios from 'axios'
import store from '@/store'
const service = axios.create({
  baseURL: 'http://ttapi.research.itcast.cn/',
  timeout: 5000
})
service.interceptors.request.use(config => {
  if (config.url.indexOf('/app/v1_0/sms/codes') === -1 && config.url.indexOf('/app/v1_0/authorizations') === -1) {
    config.headers.Authorization = 'Bearer ' + store.state.user.user.token
  }

  return config
})
export default service
